﻿CREATE TABLE [BILL].[BillItems]
(
	[Id] INT NOT NULL PRIMARY KEY IDENTITY, 
    [BillId] INT NOT NULL, 
    [ProductId] INT NOT NULL, 
    [Count] INT NOT NULL DEFAULT 1, 
    [Price] FLOAT NOT NULL DEFAULT 0, 
    CONSTRAINT [FK_BILL.BillItems_CAT.Products] FOREIGN KEY ([ProductId]) REFERENCES [CAT].[Products]([Id]), 
)

GO

CREATE INDEX [IX_BILL.BillItems_BillId] ON [BILL].[BillItems] ([BillId])

GO

CREATE INDEX [IX_BILL.BillItems_ProductId] ON [BILL].[BillItems] ([ProductId])